<template>
  <el-container>
    <el-header height="60px">
      <div>
        <span>轻量级培养方案管理系统</span>
      </div>
      <div>
        <el-button type="danger" @click="logout" round icon="el-icon-refresh-right" plain>退出登录</el-button>
      </div>
    </el-header>
    <el-container>
      <el-aside width="250px">
        <el-menu
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @close="handleClose"
          background-color="#545c64"
          text-color="#fff"
          active-text-color="#ffd04b"
          unique-opened
          router
          :collapse-transition="true">
        </el-menu>
      </el-aside>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
      <el-dialog title="消息提示" :visible.sync="addDialogVisible" width="40%" @close="logout">
        <span>没有权限，请先登录</span>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="logout">登 录</el-button>
      </div>
    </el-dialog>
  </el-container>

</template>


<script>
export default {
  data(){
    return{
      addDialogVisible:true,
    }
  },
  name: 'home',
  methods: {
    addDialogClose () {
      this.$refs.addFormRef.resetFields();
    },
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
    logout(){
      window.sessionStorage.clear();
      this.$router.push({ path: "/login"});
    }
  }
}
</script>


<style scoped>
.el-header{
  background: lightslategray;
  color: white;
  font-size: 25px;
  align-items: center;
  justify-content: space-between;
  display: flex;
}
.el-aside{
  background-color: lightslategray;
  height: 908px;
}
.el-main{
  background-color: whitesmoke;
}
.el-menu{
  border-right: 0;
}
</style>
